import request from '@/utils/request'

// 查询运营计划列表
export function listPlan(query) {
  return request({
    url: '/operate/plan/list',
    method: 'get',
    params: query
  })
}

// 查询运营计划详细
export function getPlan(id) {
  return request({
    url: '/operate/plan/' + id,
    method: 'get'
  })
}

// 新增运营计划
export function addOperatePlan(data) {
  return request({
    url: '/operate/plan/insertOperatePlan',
    method: 'post',
    data: data
  })
}

// 修改运营计划
export function updatePlan(data) {
  return request({
    url: '/operate/plan',
    method: 'put',
    data: data
  })
}

// 删除运营计划
export function delPlan(id) {
  return request({
    url: '/operate/plan/' + id,
    method: 'delete'
  })
}

// 导出运营计划
export function exportPlan(query) {
  return request({
    url: '/operate/plan/export',
    method: 'get',
    params: query
  })
}

export function getChannels() {
  return request({
    url: '/config/channel/channelData',
    method: 'get'
  })
}

export function getUserTags() {
  return request({
    url: '/operate/plan/getSelectTags',
    method: 'get'
  })
}

export function getChannTemplates(query) {
  return request({
    url: '/config/template/templateList',
    method: 'get',
    params: query
  })
}
